package main

import (
	"crypto/md5"
	"crypto/sha256"
	"golang.org/x/crypto/blake2b"
	"hash"
	"hash/crc32"
	"hash/crc64"
)

type HashAlgorithmInterface interface {
	New() hash.Hash
}

type MD5 struct{}

func (m *MD5) New() hash.Hash {
	return md5.New()
}

type SHA256 struct{}

func (s *SHA256) New() hash.Hash {
	return sha256.New()
}

type CRC32 struct{}

func (c *CRC32) New() hash.Hash {
	return crc32.NewIEEE()
}

type BLAKE2b struct{}

func (b *BLAKE2b) New() hash.Hash {
	hasher, _ := blake2b.New256(nil)
	return hasher
}

type CRC64 struct{}

func (b *CRC64) New() hash.Hash {
	return crc64.New(crc64.MakeTable(crc64.ECMA))
}
